
/**
 * AppleIIGo
 * Bit Renderer class
 * (C) 2008 by Marc S. Ressl (mressl@umich.edu)
 * Released under the GPL
 */

#include "VideoRenderer.h"

#ifndef BITRENDERER_H
#define BITRENDERER_H

#define BITRENDERER_XMARGIN		((FRAMEBUFFER_X - 560) / 2)

#define BITRENDERER_DOUBLEPIXELS_DELAY		(1 << 7)
#define BITRENDERER_DOUBLEPIXELS_LASTBIT	(1 << 8)
#define BITRENDERER_DOUBLEPIXELS_END		(1 << 9)

#define BITRENDERER_LORESPIXELS_ODD			(1 << 4)
#define BITRENDERER_LORESPIXELS_END			(1 << 5)

class BitRenderer : public VideoRenderer {
public:
	BitRenderer(class Motherboard * motherboard, UINT32 videoType,
				UINT32 characterSetType, char * characterSetRomImage);
	
	void renderScanline(UINT32 scanlineIndex);
	
protected:
	void renderScanline(UINT32 scanlineIndex, UINT32 clockIndex);
	
private:
	UINT32 horizIndex;
	
	UINT32 doublePixels[BITRENDERER_DOUBLEPIXELS_END];
	UINT32 loresPixels[BITRENDERER_LORESPIXELS_END];
	
	UINT32 pixels[APPLEII_PITCH];
	
	void initDoublePixels();
	void initLoresPixels();
};

#endif
